package com.wl.mall.service.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wl.mall.goods.entity.SkuAttribute;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wl
 * @since 2024-03-15
 */
public interface SkuAttributeMapper extends BaseMapper<SkuAttribute> {

    /***
     * 根据分类ID查询属性集合
     * @param id
     * @return
     */
    @Select("SELECT * FROM sku_attribute WHERE id IN(SELECT attr_id FROM category_attr WHERE category_id=#{id})")
    List<SkuAttribute> queryByCategoryId(Integer id);
}
